<template>
	<view>
		<view class="btn" @click="handleLogin()">登录（演示事件上报）</view>
		<view class="btn btnDraw" @click="handleDraw()">参与抽奖</view>
	</view>
</template>

<script>
export default {
	data() {
		return {};
	},
	onLoad() {
		
	},
	onHide() {
		this.unloadEvent()
	},
	methods: {
		handleLogin(){
			wx.showLoading({
				title:'加载中'
			})
			this.$dhtrack.trackEvent('loginSuccess',{
				'loginTime':new Date().getTime()
			})
			setTimeout(()=>{
				wx.hideLoading()
				wx.showToast({
					title:'登录成功',
					mask: true
				})
			},500)
		},
		handleDraw(){
			wx.navigateTo({
				url:'/pages/me/draw'
			})
		}
	}
};
</script>

<style>
	.btn{
		background-color: #ccc;border: 1px solid #ccc;height: 50px;line-height: 50px;
		margin: 20px;
		text-align: center;
	}
	.btnDraw{
		background-color: #2f85fc;
		color: #fff;
	}
</style>
